package net.zoneland.knowledge.service.impl;

import com.branchitech.gum.domain.Organization;

import net.zoneland.knowledge.exceptions.UserServiceException;
import net.zoneland.knowledge.service.UserService;

/**
 * .
 *
 * @author: bcc
 *     2022/5/10
 */
public abstract class AbstractUserService implements UserService {
    
    
    @Override
    public Organization getCompanyByCode(final String code) throws UserServiceException {
        return queryBranchCompList(true).stream()
            .filter(item -> code.equals(item.getOrgCode())).findFirst().orElse(null);
    }

    @Override
    public Organization getCompanyByName(final String orgName) throws UserServiceException {
        return queryBranchCompList(true).stream()
            .filter(item -> orgName.equals(item.getOrgName())).findFirst().orElse(null);
    }
}
